package com.love.poetry.application.poetry.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.love.poetry.application.poetry.PoetService;
import com.love.poetry.domain.poetry.Poet;
import com.love.poetry.infrastructure.persist.poetry.PoetRepository;
import com.youboy.core.orm.Page;

@Transactional
@Service
public class PoetServiceImpl implements PoetService {

	@Autowired
	private PoetRepository poetRepository;
	
	public void save(Poet poet) {
		poetRepository.save(poet);
	}

	public void update(Poet poet) {
		poetRepository.update(poet);
	}

	public void delete(Poet poet) {
		poetRepository.delete(poet);
	}

	public void delete(String id) {
		poetRepository.delete(id);
	}

	public Poet get(String id) {
		return poetRepository.get(id);
	}

	public List<Poet> query(Object object) {
		return poetRepository.query(object);
	}

	public Page<Poet> queryPage(Page<Poet> page) {
		return poetRepository.queryPage(page);
	}

	public Poet queryUniqueByName(String name) {
		return poetRepository.queryUniqueByName(name);
	}
}